package com.nsharmon.dao.entity;

import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

import org.hibernate.annotations.GenericGenerator;

import com.google.gson.annotations.Expose;

@Entity
public class Project {
	private long id;
	
	@Expose
	private String name;
	
	@Expose
	private Set<Axiom> axioms = new LinkedHashSet<Axiom>();	
	
	public Project() {
		
	}
	
	@Id
	@GeneratedValue(generator="increment")
	@GenericGenerator(name="increment", strategy = "increment")		
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(unique=true, nullable=false)
	public String getName() {
		return name;
	}	
	
	public void setName(String name) {
		this.name = name;
	}

	@OneToMany(fetch = FetchType.EAGER, cascade={ CascadeType.ALL })	
	public Set<Axiom> getAxioms() {
		return axioms;
	}

	public void setAxioms(Set<Axiom> axioms) {
		this.axioms = axioms;
	}	
}
